package com.kun.admin.authority.service;

import com.kun.base.dao.UserDao;
import com.kun.base.model.UserAndInfoModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by likun on 2016/8/11 0011.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    public String getUserNameById(int i) {
        return userDao.findNameById(i);
    }

    @Override
    public UserAndInfoModel findUserInfo(Integer id) {
        List<UserAndInfoModel> list=userDao.findUserInfoById(id);
        if (list!=null && list.size()>0){
            return list.get(0);
        }
        return null;
    }
}
